<?php
require '../conn.php';
$username = trim($_REQUEST['username']);
$password = trim($_REQUEST['password']);

if ($username =="" || $password=="")
{
	echo "{\"error\":1,\"message\":\"登陆信息不完整\"}";
	exit;
}

$query = "SELECT uid,nickname, email FROM user where username='".$username."' and password='".$password."'";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
if ($row<=0)
{
	echo "{\"error\":2,\"message\":\"用户名或者密码错误\"}";
	exit;
}
$json_str = json_encode($row);
echo $json_str;

?>